﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace server.filters
{
    public class StringDecoder : NetFilter
    {
        public void invoke(object buffer, InvocationChain invocationChain)
        {
            if (buffer is byte[])
            {
                invocationChain.invoke(Encoding.UTF8.GetString((byte[])buffer).TrimEnd());
            }
            else {
                invocationChain.invoke(buffer);
            }
        }
    }
}
